package com.yy.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 测试负载均衡
 *
 * @date 2024/5/6
 */
@RestController
public class LoadBalancerTestController {

    @Autowired
    private RestTemplate restTemplate;

    public static final String SERVICE_URL = "http://goods-service";

    @GetMapping("/test")
    public String loadbalancerTest() {
        return restTemplate.getForObject(SERVICE_URL + "/goodsServiceTest", String.class);
    }
}
